package com.zzh.bc.db.converter;


import com.zzh.bc.db.ColumnDbType;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @Date: 2021/5/24 13:43
 * @Email: zzh_hz@126.com
 * @QQ: 1299234582
 * @Author: zzh
 * @Description: 短整型 -32768~32767,  SMALLINT
 */
public class ShortColumnConverter implements ColumnConverter<Short> {
    @Override
    public Short getFieldValue(final ResultSet cursor, int index) throws SQLException {
        return  cursor.getShort(index);
    }

    @Override
    public Object fieldValue2DbValue(Short fieldValue) {
        return fieldValue;
    }

    @Override
    public ColumnDbType getColumnDbType() {
        return ColumnDbType.INTEGER;
    }
}
